#pragma once

#ifndef M_PI
#define M_PI 3.14159265358979323846264338327950288419717
#endif

#include <wx/gdicmn.h>

namespace VIS
{
	const float DEG2RAD = (float)(M_PI / 180.0);
	const float RAD2DEG = (float)(180.0 / M_PI);

	const float EARTH_RADIUS = 6378000.0;

	class CViewPort
	{
	public:
		CViewPort(void);
		~CViewPort(void);

		float Radius() const;
		int Width() const;
		int Height() const;
		wxSize Size() const;
		int NumXTiles() const;
		int NumYTiles() const;
		
		void SetRadius(float _radius);
		void SetNumXTiles(int _nx);
		void SetNumYTiles(int _ny);
		void SetWidth(int _width);
		void SetHeight(int _height);
		void SetRotate(int _rotX, int _rotY);

		void VertCoord(float _lon, float _lat, float &_x, float &_y, float &_z);
		void VertCoord(float _lon, float _lat, float _alt, float &_x, float &_y, float &_z);
		void VertCoordNorm(float _lon, float _lat, float &_x, float &_y, float &_z);


		void ResetCamera();

	private:
		
		int m_NumXTiles; //# of tiles in X
		int m_NumYTiles; //# of tiles in X
		float m_Radius; //zoom leve (pixels/global radius)
		wxSize m_Size;
	};
}

